package com.zw.mes.module.prodtaskmanager.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zw.mes.module.prodtaskmanager.entity.ProdPla;
import lombok.Data;

import javax.persistence.Transient;
import java.util.Calendar;
import java.util.Date;

/**
 * 总调计划表
 *
 * @author 徐一贺
 * @TableName prod_plan
 */
@Data
public class ProdPlaModel extends ProdPla {
    /**
     * 排产状态：1=未排产，2=已排产
     */
    private Integer schedulingStatus;
    /**
     * 总调计划表主键
     */
    private Integer propId;
    /**
     * 生产令主键
     */
    private Integer prodId;
    /**
     * 生产令名称
     */
    private String prodName;
    /**
     * 审核状态 查询条件
     */
    private String propStaStr;

    /**
     * 交货时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date prodDelDat;
    /**
     * 是否重点：1是重点,0不是
     */
    private Integer prodIsKey;

    /**
     * 开始时间
     */
    @Transient
    private Date startTime;


    /**
     * 工艺计划完成时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date tecComDat;
    /**
     * 原材料计划回货时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date rawMalRetDat;
    /**
     * 生产计划完成时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date prodComDat;
    /**
     * 装配计划完成时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date assComDat;
    /**
     * 安装计划完成时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date insComDat;

    /**
     * 结束时间
     */
    @Transient
    private Date endTime;
    public void setEndTime(Date endTime) {
        if (endTime != null) {
            Calendar cal = Calendar.getInstance();
            cal.setTime(endTime);
            cal.add(Calendar.DAY_OF_YEAR, 1);
            this.endTime = cal.getTime();
        }
    }

    @Transient
    private Date startTime2;
    /**
     * 结束时间
     */
    @Transient
    private Date endTime2;
    public void setEndTime2(Date endTime2) {
        if (endTime2 != null) {
            Calendar cal = Calendar.getInstance();
            cal.setTime(endTime2);
            cal.add(Calendar.DAY_OF_YEAR, 1);
            this.endTime2 = cal.getTime();
        }
    }

    /**
     * 项目表主键id
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer proId;
    /**
     * 页面检索使用 提交状态
     */
    private Integer status;

    /**
     * 意向表主键id
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer preEnqId;

    /**
     * 项目编号
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private String proCode;

    /**
     * 项目等级
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer proClass;

    /**
     * 项目类别
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer proType;

    /**
     * 项目名称
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private String proName;

    /**
     * 需方
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private String customer;

    /**
     * 安装地点
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private String insSite;

    /**
     * 数量
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer proQty;

    /**
     * 单位
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private String proUnit;

    /**
     * 特种设备类型
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer speEquipType;

    /**
     * 设计部门
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer designType;

    /**
     * 设计
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer design;

    /**
     * 材料
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer meteral;

    /**
     * 制造
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer manuf;

    /**
     * 包装
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer pack;

    /**
     * 运输
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer trans;

    /**
     * 安装
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer install;

    /**
     * 调试
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer debug;

    /**
     * 备品备件
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer spareParts;

    /**
     * 是否由技术部设计
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer designStatus;

    /**
     * 是否有生产
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer productStatus;

    /**
     * 制造范围
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private String manufScope;

    /**
     * 是否有食宿
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer accommodate;

    /**
     * 是否有差旅
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer onBusiness;

    /**
     * 是否有吊车
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer crane;

    /**
     * 是否有保运
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer maintainInTest;

    /**
     * 包装要求
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private String packReq;

    /**
     * 主要技术要求
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private String mainTechReq;

    /**
     * 备注
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private String remark;

    /**
     * 意向变更备注
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private String preEnqChgRmk;

    /**
     * 创建日期
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Date createDate;

    /**
     * 创建人
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private String createName;

    /**
     * 项目取消标识 0=未取消；1=取消
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer proCancelMark;

    /**
     * 项目状态 1=待提交；2=已提交；3 = 审核中；4=已同意
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer proStatus;

    /**
     * 技术协议上传状态 1=已上传；2=未上传；3=不需要
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer proTechAgreement;

    /**
     * 是否发起验收 是否发起验收： 1=已发起；2=未发起
     *
     * @mbg.generated Wed Jan 13 16:31:16 CST 2021
     */
    private Integer proCheckStatus;

    /**
     * 申请人
     */
    private String applicant;
    /**
     * 排产人
     */
    private String schNam;
    /**
     * 生产完成状态
     */
    private Integer productionCompletionStatus;

    /**
     * 分类：1=设备类，2=其他
     */
    private Integer prodTyp;
}